package com.sykj.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sykj.bean.BisNurseBagPage;
import com.sykj.bean.BisNurseProjectPage;
import com.sykj.service.BisNurseProjectService;
import com.sykj.util.reponse.BaseResponse;
import com.sykj.util.reponse.CommonEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController

public class BisNurseProjectController {

    @Autowired
    private BisNurseProjectService bisNurseProjectService;

    @RequestMapping("bisNurseProject/querys")
    public BaseResponse querys(BisNurseProjectPage bisNurseProjectPage){

        Page pages= new Page(bisNurseProjectPage.getPage(),bisNurseProjectPage.getLimit());

        IPage<BisNurseProjectPage> querys = bisNurseProjectService.querys(pages, bisNurseProjectPage);

        return new BaseResponse(CommonEnum.LAYUI_SUCCESS,querys);
    }

    @GetMapping(value = "bisNurseProject/bisNurseBagProjectListid")
    public BaseResponse bisNurseBagProjectListid(BisNurseProjectPage cusetomBisNurseProject){
        List<BisNurseProjectPage> bisNurseProjectsListid=bisNurseProjectService.bisNurseBagProjectListid(cusetomBisNurseProject);
        return new BaseResponse(CommonEnum.LAYUI_SUCCESS,bisNurseProjectsListid);
    };


}
